<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <hjw v-for="item in items" v-bind:q="item"></hjw>
    <!--将遍历的值绑定给q  实现传值 -->

</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script>
<!--    自定义组件 -->
    Vue.component("hjw",{
        /* 需要传值给组件  勇敢props */
        props: ['q'],
        template: '<li>{{q}}</li>'
    });

    var vm=new Vue({
        el:"#app",
        data:{
            items: ["java","js","linux"]
        }
    });


</script>
</body>
</html>